// 导入 Vue Router 核心函数
import { createRouter, createWebHistory } from 'vue-router'
// 导入你的主页组件（假设是 Home.vue）
import Home from '../views/Home.vue'

// 定义路由规则=====================首页==========================
const routes = [
  {
    path: '/',          // 根路径（首页）
    name: 'Home',
    component: Home     // 对应渲染的组件
  },
  // 后续添加新页面时，在这里继续加路由规则即可
  // { path: '/about', name: 'About', component: () => import('../views/About.vue') }

  // 添加About路由=====================关于我们（学院简介）==========================
  {
    path: '/about', 
    name: 'About', 
    component: () => import('../views/About.vue') 
  },

    // 添加行政机构总览页面路由=========================机构设置======================
  {
    path: '/adminDeptPage',
    name: 'AdminDeptPage',
    component: () => import('../views/adminDept/AdminDeptPage.vue')
  },

     // 添加行政机构路由
  {
    path: '/adminDept',
    name: 'AdminDept',
    component: () => import('../views/adminDept/AdminDept.vue')
  },
    // 添加行政机构详情页路由
  {
    path: '/adminDeptDetail',
    name: 'AdminDeptDetail',
    component: () => import('../views/adminDept/AdminDeptDetail.vue'),
    props: true
  },
  // 添加院系设置路由
  {
    path: '/departmental', 
    name: 'Departmental', 
    component: () => import('../views/department/Departmental.vue') 
  },
    // 添加院系详情页设置路由
  {
    path: '/departmentalDetail/:departmentName', 
    name: 'DepartmentalDetail', 
    component: () => import('../views/department/DepartmentDetail.vue'),
    props: true 
  },


  // 添加人才培养路由 ===========================人才培养==================================
  {
    path: '/talentTrainingPage', 
    name: 'TalentTrainingPage', 
    component: () => import('@/views/talentTraining/TalenTrainingPage.vue') 
  },

  // 添加人才类别列表路由
  {
    path: '/talentCategoryList', 
    name: 'TalentCategoryList', 
    component: () => import('@/views/faculty/TalentCategoryList.vue') 
  },

   //添加人才培养路由 - 学习计划
  {
    path: '/learningPlan', 
    name: 'LearningPlan', 
    component: () => import('@/views/talentTraining/LearningPlan.vue'),
    props: true 
  },
  //添加学习计划详情页路由
  {
    path: '/learningPlanDetail/:type/:id', 
    name: 'LearningPlanDetail', 
    component: () => import('@/views/talentTraining/LearningPlanDetail.vue'),
    props: true 
  },
    //添加人才培养路由 - 能力测试
  {
    path: '/abilityExam', 
    name: 'AbilityExam', 
    component: () => import('@/views/talentTraining/AbilityExam.vue'),
    props: true 
  },
      //添加人才培养路由 - 证书考试
  {
    path: '/certificateExams', 
    name: 'CertificateExams', 
    component: () => import('@/views/talentTraining/CertificateExams.vue'),
    props: true 
  },

  //添加师资力量路由==============================师资力量==================================
  {
    path: '/faculty',
    name: 'FacultyList',
    component: () => import('@/views/faculty/FacultyList.vue')
  },
  // 添加师资力量路由，支持query参数访问方式
  {
    path: '/facultyDetail',
    name: 'FacultyDetailByQuery',
    component: () => import('@/views/faculty/FacultyDetail.vue')
  },
    // 单个教师详情页（可选）
  {
    path: '/faculty/:teacherId',
    name: 'FacultyDetail',
    component: () => import('@/views/faculty/FacultyDetail.vue')
  },
  // 添加招生信息总览页面路由=======================招生信息=======================================
  {
    path: '/admissionCareerPage', 
    name: 'AdmissionCareerPage', 
    component: () => import('../views/admission/AdmissionCareerPage.vue') 
  },
 //招生信息
  {
    path: '/admission', 
    name: 'AdmissionInfo', 
    component: () => import('../views/admission/Admission.vue') 
  },
  // 添加职业指导路由
  {
    path: '/careerGuidance', 
    name: 'CareerGuidance', 
    component: () => import('../views/admission/CareerGuidance.vue') 
  },
  
  // 添加图书馆路由==============================图书馆==================================
  {
    path: '/library', 
    name: 'Library', 
    component: () => import('../views/library/Library.vue') 
  }
  //添加学生心声（计划中）
]

// 创建路由实例
const router = createRouter({
  history: createWebHistory(), // 使用 HTML5 历史模式（无 # 号）
  routes,                      // 应用路由规则
  scrollBehavior() {
    // 始终滚动到顶部
    return { top: 0 }
  }
})

export default router